{layout name="../common/master"/}
<div id="right">
       <h4 style="border-bottom: 1px solid #ccc;padding-bottom: 3px">用户借款列表</h4>
    <form action="" method="get" role="form">
        <div class="form-group">

            <label for="">用户电话：</label>
            <input name="userPhone" {if condition="isset($_GET['userPhone'])"} value="{$_GET['userPhone']}" {/if} type="text"/>

            <label for="">审核状态：</label>
            <select name="auditProcessStatus" >
                <option value="11" selected>全部</option>
                <option {if condition="isset($_GET['auditProcessStatus']) AND ($_GET['auditProcessStatus'] eq 0)"} selected {/if} value="0">待审核</option>
                <option {if condition="isset($_GET['auditProcessStatus']) AND ($_GET['auditProcessStatus'] eq 1)"} selected {/if} value="1">审核通过</option>
                <option {if condition="isset($_GET['auditProcessStatus']) AND ($_GET['auditProcessStatus'] eq 2)"} selected {/if} value="2">审核不通过</option>
            </select>

           <label for="">放款状态：</label>
            <select name="transactionStatus"  >
                <option value="11" selected>全部</option>
                <option {if condition="isset($_GET['transactionStatus']) AND ($_GET['transactionStatus'] eq 0)"} selected {/if} value="0">未放款</option>
                <option {if condition="isset($_GET['transactionStatus']) AND ($_GET['transactionStatus'] eq 1)"} selected {/if} value="1">放款成功</option>
                <option {if condition="isset($_GET['transactionStatus']) AND ($_GET['transactionStatus'] eq 2)"} selected {/if} value="2">放款不成功</option>
                <option {if condition="isset($_GET['transactionStatus']) AND ($_GET['transactionStatus'] eq 3)"} selected {/if} value="3">放款中</option>
            </select>

            <label for="">还款状态：</label>
            <select name="loanRepayStatus" >
                <option value="11" selected>全部</option>
                <option {if condition="isset($_GET['loanRepayStatus']) AND ($_GET['loanRepayStatus'] eq 0)"} selected {/if} value="0">未产生还款</option>
                <option {if condition="isset($_GET['loanRepayStatus']) AND ($_GET['loanRepayStatus'] eq 1)"} selected {/if} value="1">待还款</option>
                <option {if condition="isset($_GET['loanRepayStatus']) AND ($_GET['loanRepayStatus'] eq 2)"} selected {/if} value="2">还款中</option>
                <option {if condition="isset($_GET['loanRepayStatus']) AND ($_GET['loanRepayStatus'] eq 3)"} selected {/if} value="3">还款完成</option>
            </select>
            <br>
            <label for="">借款金额：</label>
            <input name="uploanAmount" {if condition="isset($_GET['uploanAmount'])"} value="{$_GET['uploanAmount']}" {/if} type="text"/>
            ~
            <input name="downloanAmount" {if condition="isset($_GET['downloanAmount'])"} value="{$_GET['downloanAmount']}" {/if} type="text" />

            <label for="">借款时长：</label>
            <input name="uploanRepayPeriod" {if condition="isset($_GET['uploanRepayPeriod'])"} value="{$_GET['uploanRepayPeriod']}" {/if} type="text"/>
            ~
            <input name="downloanRepayPeriod" {if condition="isset($_GET['downloanRepayPeriod'])"} value="{$_GET['downloanRepayPeriod']}" {/if} type="text"/>

            <label for="">借款时间：</label>
            <input name="upcreateTime" {if condition="isset($_GET['upcreateTime'])"} value="{$_GET['upcreateTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
            ~
            <input name="downcreateTime" {if condition="isset($_GET['downcreateTime'])"} value="{$_GET['downcreateTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>

            <label for="">放款时间：</label>
            <input name="uploanArrangeTime" {if condition="isset($_GET['uploanArrangeTime'])"} value="{$_GET['uploanArrangeTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
            ~
            <input name="downloanArrangeTime" {if condition="isset($_GET['downloanArrangeTime'])"} value="{$_GET['downloanArrangeTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>




        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
    <div>
        <button id="extend" type="submit" class="btn btn-info">导出到EXCEL</button>
    </div>
    <table class="table-bordered table  table-hover" style="margin-top: 20px;">
        <thead>
        <tr>
            <th>ID</th>
            <th>用户ID</th>
            <th>用户电话</th>
            <th>交易ID</th>
            <th>产品ID</th>
            <th>借款金额</th>
            <th>借款时长</th>
            <th>管理费</th>
            <th>年利率</th>
            <th>年利率实际借款</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name="data" item="vo" key="k"}
            <tr>
                <th>{$vo['id']}</th>
                <th>{$vo['userID']}</th>
                <th>{$vo['userPhone']}</th>
                <th>{$vo['transactionID']}</th>
                <th>{$vo['productID']}</th>
                <th>{$vo['loanAmount']}</th>
                <th>{$vo['loanRepayPeriod']}</th>
                <th>{$vo['managementFee']}</th>
                <th>{$vo['loanInterestRate']}</th>
                <th>{$vo['actualAmount']}</th>
                <th>{$vo['createdAt']}</th>
                <th>
                    <div class="btn-group">
                        <a style="margin-left: 5px" href="{:URL('home/Userloan/userLoanInfo',['uid'=>$vo['id'],'type'=>1])}" class="btn btn-primary btn-sm">查看详情</a>
                    </div>
                </th>
            </tr>
        {/foreach}
        </tbody>
    </table>
    {$page} 总数：{$totalCount}   跳到 <input id="jumpTo" type="number" style="width: 40px"> 页 <button id="jump">跳转</button>

</div>
<script>
    $("#extend").click(function () {
        var url="{:URL('home/Userloan/userloanList',$_GET)}";
        url=url+"&extend=1";
        location.href=url;
    })
    $("#jump").click(function(){
        var jumpTo=$("#jumpTo").val();
        var url=location.href;
        var urlPreg=/\?+/;
        if(urlPreg.test(url)){
            url += "&p="+jumpTo;
        }else{
            url += "?p="+jumpTo;
        }
        location.href=url;
    })
</script>
<script type="text/javascript" src="__PUBLIC__/home/tuo/DatePicker/WdatePicker.js"></script>
